﻿@using Smarly.Bussines.Membership
@using Smarly.Core
@model Smarly.Bussines.Model.BookTree

	@{
		bool isAllowEdit = ViewBag.IsAllowEdit;//User.IsInRole("Admin") || ((SmarlyPrincipal)User).AllowChanges(Model.Url);

		bool isViewer = ViewBag.ShowContent;//isAllowEdit || (User.Identity.IsAuthenticated && User.IsInRole("Viewer"));

	}

<div class="next-content-bottom">
	<script type="text/javascript">
		$().ready(function () {
			$('form.form-subscribe').smarlyValidation({
				popoverOptions: {
					placement: 'top'
				},
				onSuccess: function (data, form, base) {
					var element = 'Email';
					base.addRemoteRule(form, element, 'success', data.message, [$('[name="' + element + '"]', form).val(), 'green']);
				}
			});
		});
	</script>

	@using (Html.BeginForm("Index", "Subscriber", FormMethod.Post, new { @class = "form-subscribe" }))
	{
		var identity = (SmarlyIdentity)User.Identity;
		var subscribeValue = identity.IsAuthenticated && !identity.IsSubscriber ? identity.Name : "";
		var subscribePlaceHolder = identity.IsAuthenticated && identity.IsSubscriber ? identity.Name : "Подпишитесь на рассылку";
			 
		<div class="input-append">
			<input type="email" id="Email" name="Email" value = "@subscribeValue" placeholder = "@subscribePlaceHolder" />
			<button type="submit" class="btn">Подписаться</button>
		</div>
	}
	
	<span class="rss-link"> или <strong>RSS канал:</strong> </span><a   rel="nofollow" class="rss-link" href="http://storage.smarly.net/smarly/published.rss"><img src="/img/rss.png" alt="Что новенького на smarly.net"></a>
			

	<script type="text/javascript" src="http://yandex.st/share/share.js" charset="utf-8"></script>
	<script type="text/javascript">
		$().ready(function () {
			var yaShareInstance = new Ya.share({
				element: 'ya_share',
				l10n: 'ru',

				popupStyle: {
					copyPasteField: false,
					blocks: ['digg', 'evernote', 'delicious', 'diary', 'liveinternet', 'friendfeed', 'juick', 'moikrug', 'moimir', 'myspace', 'tutby', 'odnoklassniki', 'lj', 'yazakladki']

				},
				elementStyle: {
					//type: "none",
					text: "Поделиться...",
					border: false,
					quickServices: ['vkontakte', 'facebook', 'gplus', 'twitter', 'linkedin', 'yaru', 'blogger', '']
				},
				onready: function (instance) {
				}
			});
		});
	</script>

	<div id="ya_share" style="height: 50px;" class="right"></div> 
</div>
